<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'test1.jsp' starting page</title>
    <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/userQueryService.js'></script>
  	
	<script type="text/javascript" src="<%=path %>/script/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="<%=path %>/script/easyui/jquery.easyui.min.js"></script>
	<link rel="stylesheet" href="<%=path %>/script/easyui/themes/default/easyui.css" type="text/css"/>
	<link rel="stylesheet" href="<%=path %>/script/easyui/themes/icon.css" type="text/css"/>
	<script type="text/javascript" src="<%=path %>/script/easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="<%=path %>/script/easyui/dwrloader.js"></script>
	<script type="text/javascript" src="<%=path %>/script/common.js"></script>
  	<script type="text/javascript">
  		$(function(){
  			 $('#test').datagrid({
  				 idField: 'ID',  
                 columns: [[  
                     {field:"ID",checkbox:true},  
                     //{field:"ID",title:'ID',width:80,sortable:true},  
                     {field:"USERNAME",title:'用户名',width:300,sortable:true},  
                     {field:"PWD",title:'密码',width:100,sortable:true},  
                     {field:"STATU",title:'状态',width:100,sortable:true}  
                 ]],  
                 singleSelect: true,//True to allow selecting only one row.
                 rownumbers: true,//True to show a row number column.
                 checkOnSelect:true,//行选择时勾上复选框
                 autoRowHeight: false,  
                 width: 580,  
                 height: 400,  
                 pagination:true,
                 remoteSort:false, // 是否远程排序。是则在服务器将数据排序后再发过来，否就是在客户端页面排序
                 multiSort:true,
                 url: userQueryService.query2
             });  
  	  	});

  		function searchFun(){
  			var con1 = new Condition("id","equal","aaaaa","");
  			console.dir(con1);
  			var con2 = new Condition("name","lt","bbbbb");
  			var or1 = new Or(con1,con2);
  			var and = new And(con1,con2);
  			//var con3 = new Condition("age","gt","cccc");
  			//var and2 = new And(con3,and);
  			//var or = new Or(and,and2);
  			//var c = new DWRCondition(con3);
  			//console.dir(c);
  			var and2 = new And(or1,and);
  			//$("#test").datagrid('options').queryParams = {codition : condition};
			//$('#test').datagrid('load',{
			//	condition : and2,
			//});
			$("#test").gridFilter(new Condition("id","equal","1"));
		}
  	</script>
  
  
  
  </head>
  
  <body>
  	<a href="javascript:void(0);" class="easyui-linkbutton" onclick="searchFun()">查询</a>
    <table id="test"></table>
  </body>
</html>
